package com.mobile.persistent.entity;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.mobile.persistent.base.BaseEntity;

/**
 * @author qingqiu
 * 公司信息表
 */
@Entity
@Table(name="companyInfo")
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
public class CompanyInfo extends BaseEntity {
	private static final long serialVersionUID = 1L;

	private String compName;
	private String compAddress;
	private String compTel;
	private String compMobile;
	/**
	 * 分店的员工列表
	 */
	private List<Staffs> staffsList;
	/**
	 * 公司或分店负责人
	 */
	private String compManager;
	
	@Column(name="compName", columnDefinition="varchar(20)", nullable=false)
	public String getCompName() {
		return compName;
	}
	public void setCompName(String compName) {
		this.compName = compName;
	}
	@Column(name="compAddress", columnDefinition="varchar(100)")
	public String getCompAddress() {
		return compAddress;
	}
	public void setCompAddress(String compAddress) {
		this.compAddress = compAddress;
	}
	@Column(name="compTel", columnDefinition="varchar(15)")
	public String getCompTel() {
		return compTel;
	}
	public void setCompTel(String compTel) {
		this.compTel = compTel;
	}
	@Column(name="compMobile", columnDefinition="varchar(15)")
	public String getCompMobile() {
		return compMobile;
	}
	public void setCompMobile(String compMobile) {
		this.compMobile = compMobile;
	}
	@Column(name="compManager", columnDefinition="varchar(10)")
	public String getCompManager() {
		return compManager;
	}
	public void setCompManager(String compManager) {
		this.compManager = compManager;
	}
	@OneToMany(mappedBy="companyInfo", fetch=FetchType.LAZY)
	@org.hibernate.annotations.Fetch(org.hibernate.annotations.FetchMode.SUBSELECT)
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE,
		org.hibernate.annotations.CascadeType.DELETE,
		org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	public List<Staffs> getStaffsList() {
		return staffsList;
	}
	public void setStaffsList(List<Staffs> staffsList) {
		this.staffsList = staffsList;
	}
	
}
